﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;

namespace Grain.Crm.ExcelImporter
{
    public static class EnumerableRowCollection
    {
        public static string GetValue(this EnumerableRowCollection<DataRow> collection, int xlsRow, int xlsColumn)
        {
            return collection.ElementAt(xlsRow - 1).Field<string>(xlsColumn - 1);
        }

        public static DataRow GetRow(this EnumerableRowCollection<DataRow> collection, int xlsRow)
        {
            return collection.ElementAt(xlsRow - 1);
        }

        public static string GetValue(this DataRow row, int xlsColumn)
        {
            return row.Field<string>(xlsColumn - 1);
        }
    }
}
